using System;
using System.Collections.Generic;
using System.Text;
using System.IO;
using System.Threading;
using System.Collections.ObjectModel;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;
using ViewOnCore.Helper.WPF;
using ViewOn.Kernel;

namespace ViewOn.UI.Dialog
{

    public partial class EqualizerDialog : System.Windows.Controls.UserControl
    {

        #region Constructor

        public EqualizerDialog()
        {
            InitializeComponent();

			btnClose.IsEnabled = false;

			this.childWindowDecorator.VisuallyReady += new EventHandler(childWindowDecorator_VisuallyReady);
        }

		void childWindowDecorator_VisuallyReady(object sender, EventArgs e)
		{
            btnClose.IsEnabled = true;
		}

        #endregion

        #region Close

        private void btnClose_Click(object sender, System.Windows.RoutedEventArgs e)
        {
            childWindowDecorator.Close();
        }

        #endregion

        #region ShowDialog

        /// <summary>
        /// Show the dialog.
        /// </summary>
        /// <param name="container">The desktop</param>
        /// <param name="handler">This handler handle when the dialog is closed</param>
        public void ShowDialog(Desktop container, ChildWindowDialogClosedHandler handler)
        {
            childWindowDecorator.ShowDialog(container, handler);
        }

        /// <summary>
        /// Show the dialog.
        /// </summary>
        /// <param name="container">The desktop</param>
        public void ShowDialog(Desktop container)
        {
            childWindowDecorator.ShowDialog(container);
        }

        #endregion

    }

}